﻿using FE.Shared;

namespace FE.Common
{
    public static class AppSettingsTool
    {
        public static string GetConnectionString(AppSettings appSettings)
        {
            //todo 目前只支持mysql

            if (appSettings == null)
            {
                return string.Empty;
            }

            return
                $"server={appSettings.ServerMySqlSettings.HostIp};" +
                $"port={appSettings.ServerMySqlSettings.Port};" +
                $"Database={appSettings.ServerMySqlSettings.DatabaseName};" +
                $"Uid={appSettings.ServerMySqlSettings.Username};" +
                $"Pwd={appSettings.ServerMySqlSettings.Password}";
        }
    }
}